app.get("/get1",(req,res)=>{
    let r={
        "data":"get1 ok"
    }
     res.end(JSON.stringify(r))

})



app.post("/postJson",(req,res)=>{
    
        let r={
            "data":"postjson ok"
        }
        res.end(JSON.stringify(r))

})




app.mapping("/postJson",(req,res)=>{
       console.log("-----------"+req.method)
        let r={
            "data":"postjson options"
        }
        res.end(JSON.stringify(r))
})





app.get("/getCookie",(req,res)=>{
    res.end(M.result(req.cookies));
})





app.get("/setCookie",(req,res)=>{
    res.end(M.result(req.cookies));
})






app.get("/getHeader",(req,res)=>{
   let hs= req.headers['x-header1']
    res.end(M.result(hs));
})





app.begin((req,res)=>{
    if(req.url.startsWith("/_run_")){
        return;
    }
    console.log(req.method+" "+req.url,req.body)
})